package cn.chen.controller;

import cn.chen.service.TagService;
import cn.chen.vo.Result;
import cn.chen.vo.TagVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("tags")
public class TagsController {
    @Autowired
    private TagService tagService;

    /**
     * 最热标签
     */
    @GetMapping("hot")
    public Result hot(){
        int limit=6;
        List<TagVo> tagVoList= tagService.hots(limit);
        return Result.success(tagVoList);
    }
    /**
     * 所有标签
     */
    @GetMapping
    public Result findAll(){
        return tagService.findAll();
    }
}
